export default {
  state: {
    roomData: {},
    roomId: '',
    msgData: [],
    crmRoomData: {},
    crmRoomId: '',
    salerId: '',
    orderId: '',
    crmMsgData: []
  },
  getters: {
    msgData (state) {
      return state.msgData
    },
    crmMsgData (state) {
      return state.crmMsgData
    }
  },
  actions: {
    handleUpdateRoomData({ commit }, roomData) {
      commit("updateRoomData", roomData);
    },
    handleUpdateRoomId({ commit }, roomId) {
      commit("updateRoomId", roomId);
    },
    handleUpdateMsgData({ commit }, msgData) {
      commit("updateMsgData", msgData);
    },
    handleUpdateCrmRoomData({ commit }, roomData) {
      commit("updateCrmRoomData", roomData);
    },
    handleUpdateCrmRoomId({ commit }, roomId) {
      commit("updateCrmRoomId", roomId);
    },
    handleUpdateCrmMsgData({ commit }, msgData) {
      commit("updateCrmMsgData", msgData);
    }
  },
  mutations: {
    updateRoomData (state, data) {
      state.roomData = data
    },
    updateRoomId (state, data) {
      state.roomId = data
    },
    updateMsgData (state, data) {
      state.msgData = data
    },
    updateCrmRoomData (state, data) {
      state.crmRoomData = data
    },
    updateCrmRoomId (state, data) {
      state.crmRoomId = data
    },
    updateCrmMsgData (state, data) {
      state.crmMsgData = data
    },
    updateSalerId (state, data) {
      state.salerId = data
    },
    updateOrderId (state, data) {
      state.orderId = data
    }
  }
}